package com.liaoban.app.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.liaoban.app.R;
import com.liaoban.app.api.type.ShareIndex;
import com.liaoban.app.helper.ImageHelper;
import com.liaoban.app.util.CommonUtils;

import java.util.List;

/**
 * Created by ybc on 2018/7/13 0013.
 * 分享赚钱排行榜
 */
public class ShareMoneyAdapter extends BaseQuickAdapter<ShareIndex.ListBean, BaseViewHolder> {

    public ShareMoneyAdapter(@Nullable List<ShareIndex.ListBean> data) {
        super(R.layout.item_share_money, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ShareIndex.ListBean item) {
        helper.setText(R.id.tv_pos, "" + (helper.getLayoutPosition() + 1));
        ImageView ivSrc = helper.getView(R.id.iv_src);
        ImageHelper.load(ivSrc, CommonUtils.getFullPic(item.getSrc()));
        helper.setText(R.id.tv_name, item.getName());
        helper.setText(R.id.tv_money, item.getMoney());
    }
}
